home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 46
/
Amiga Format CD46 (1999-10-20)(Future Publishing)(GB)[!][issue 1999-12].iso
/
-in_the_mag-
/
reader_requests
/
scilab
/
demos
/
lmitool
/
sylvester.sci
< prev
next >
Wrap
Text File
|
1999-09-16
|
1KB
|
36 lines
function [X]=sylvester(A,B,C,flag)
// Generated by lmitool on Thu Feb 09 11:55:34 MET 1995
Mbound = 1e3;
abstol = 1e-10;
nu = 10;
maxiters = 100;
reltol = 1e-10;
options=[Mbound,abstol,nu,maxiters,reltol];
///////////DEFINE INITIAL GUESS AND PRELIMINARY CALCULATIONS BELOW
[na,ma]=size(A);[nb,mb]=size(B)
if ma<>na|mb<>nb then error("invalid dimensions");end
X_init=zeros(ma,nb)
///////////
XLIST0=list(X_init)
XLIST=lmisolver(XLIST0,sylvester_eval,options)
[X]=XLIST(:)
/////////////////EVALUATION FUNCTION////////////////////////////
function [LME,LMI,OBJ]=sylvester_eval(XLIST)
[X]=XLIST(:)
/////////////////DEFINE LME, LMI and OBJ BELOW
if flag=='c' then LME=A*X+X*B-C
else LME=A*X*B-C
end
LMI=[]
OBJ=[]